# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-xattr
pkgver=0.10.1
pkgrel=2
pkgdesc='Python wrapper for extended filesystem attributes'
arch=('loong64' 'x86_64')
license=('MIT')
url='https://github.com/xattr/xattr'
depends=('python-cffi')
makedepends=('python-setuptools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/xattr/xattr/archive/v$pkgver.tar.gz")
sha512sums=('85151e5dda925193d17dcc892d46e22c6a288776df24e3e14a5a6d26a05e4a818685dfc656576a1c96c0954aec7e1e1c1f5d6b94f7102d995cf8bfccdea98bc2')

build() {
  cd xattr-$pkgver
  python setup.py build
}

check() { (
  # Build env doesn't have permission for those xattrs
  cd xattr-$pkgver
  python setup.py test
  ) || echo "Tests failed"
}

package() {
  cd xattr-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim:set ts=2 sw=2 et:
